package top.techqi.hamtools.db.assist

import android.support.annotation.IntRange

enum class RstS(val value: Int) {
    UNKNOWN(0),
    FAINT(1),
    FEEBLE(2),
    WEAK(3),
    FAIR(4),
    FAIRLY(5),
    GOOD(6),
    MODERATELY(7),
    STRONG(8),
    EXTREMELY(9);

    companion object {
        fun valueOf(@IntRange(from = 0, to = 9) value: Int): RstS {
            return when (value) {
                1 -> RstS.FAINT
                2 -> RstS.FEEBLE
                3 -> RstS.WEAK
                4 -> RstS.FAIR
                5 -> RstS.FAIRLY
                6 -> RstS.GOOD
                7 -> RstS.MODERATELY
                8 -> RstS.STRONG
                9 -> RstS.EXTREMELY
                else -> RstS.UNKNOWN
            }
        }
    }
}
